package com.online.studyonline.mapper;

import com.online.studyonline.pojo.Note;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author urts
* @description 针对表【note】的数据库操作Mapper
* @createDate 2024-09-26 20:07:03
* @Entity cn.learn.onlinelearning.pojo.Note
*/
@Mapper
public interface NoteMapper extends BaseMapper<Note> {
    @Select("select Note.*,Course.course_name from Note , Course where Note.user_id = #{id} and Note.course_id = Course.course_id")
    List<Note> getNoteByUserId1(Integer id);


    @Select("select Note.*,Course.course_name,Users.username from  Note,Course,Users where " +
            " Note.course_id = Course.course_id" +
            " and Note.user_id = Users.user_id")
    List<Note> getAll();
}




